package com.beikai.redisdemo.utils;

import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @author : hanbeikai
 * Date: 2021/5/12 9:01 下午
 * Description: No Description
 */
@Component
public class Profile implements EnvironmentAware {

    private Environment environment;

    @Override
    public void setEnvironment(Environment environment) {
        this.environment = environment;
    }

    public String getEnv(){
        return environment.getActiveProfiles()[0];
    }

}
